import workTableLinkUrl from '@const/path'
// 待办事务类型
export const AFFAIRS_TYPE = {
  0: '首营资质交换',
  1: '合同签约',
  2: '政策下发',
  3: '政策结果下发',
  4: '财务管理',
  5: '结算管理',
  6: '医院授权管理'
}
// 待办事务跳转地址
export const LINK_URL = {
  0: workTableLinkUrl.qualification_exchange, // 首营资质交换
  1: workTableLinkUrl.contract_authorization, // 合同管理-签约授权
  2: workTableLinkUrl.publishing_policy, // 政策管理-发布政策
  3: workTableLinkUrl.publishing_policy_result, // 政策结果下发
  4: workTableLinkUrl.should_pay_order, // 财务管理-应付订单
  5: workTableLinkUrl.settlement_sale_add, // 结算管理-寄售补货单
  6: workTableLinkUrl.hospital_authorization // 医院授权管理-申请医院授权
}
export const LICENCE_TYPE = {
  0: '企业证照',
  1: '产品证照'
}
// 查询条件
export const SEARCH_FORM = [
  {
    key: 'type',
    title: '事务类型',
    type: 'select',
    attr: {
      placeholder: '请选择',
      clearable: true,
      filterable: true
    },
    options: Object.keys(AFFAIRS_TYPE).map(it => {
      return {
        label: AFFAIRS_TYPE[it],
        value: it
      }
    })
  },
  {
    key: 'relatedMan',
    title: '负责人',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  }
]
// 待办事务列表表头
export const TABLE_COLUMNS = [
  {
    type: 'index',
    label: '序号',
    width: 80
  },
  {
    prop: 'type',
    label: '事务类型',
    minWidth: 160,
    formatter: row => AFFAIRS_TYPE[Number(row.type)] || ''
  },
  {
    prop: 'relatedMan',
    label: '负责人',
    minWidth: 160
  },
  {
    prop: 'todoList',
    label: '待办事项',
    width: 100
  },
  {
    prop: 'action',
    label: '操作',
    width: 120
  }
]
// 证照预警查询条件
export const LICENCE_FORM = [
  {
    key: 'type',
    title: '事务类型',
    type: 'select',
    attr: {
      placeholder: '请选择',
      clearable: true,
      filterable: true
    },
    options: Object.keys(LICENCE_TYPE).map(item => {
      return {
        label: LICENCE_TYPE[item],
        value: item
      }
    })
  }
]
// 证照预警表头
export const LICENCE_COLUMNS = [
  {
    type: 'index',
    label: '序号',
    width: 80
  },
  {
    prop: 'licenceType',
    label: '证照类型',
    minWidth: 120,
    formatter: row => LICENCE_TYPE[Number(row.licenceType)] || ''
  },
  {
    prop: 'licenceName',
    label: '证照名称',
    minWidth: 200,
    'show-overflow-tooltip': true
  },
  {
    prop: 'period',
    label: '效期',
    width: 100
  },
  {
    prop: 'expired',
    label: '已过期天数',
    width: 100
  },
  {
    prop: 'action',
    label: '操作',
    width: 160
  }
]
// 表格数据
export const tableData = [
  {
    id: '1',
    type: 0,
    relatedMan: '张三',
    todoList: 1
  },
  {
    id: '2',
    type: 1,
    relatedMan: '张三',
    todoList: 3
  },
  {
    id: '3',
    type: 2,
    relatedMan: '张三',
    todoList: 5
  },
  {
    id: '4',
    type: 4,
    relatedMan: '小明',
    todoList: 1
  },
  {
    id: '5',
    type: 3,
    relatedMan: '王五',
    todoList: 1
  },
  {
    id: '6',
    type: 6,
    relatedMan: '小米',
    todoList: 1
  },
  {
    id: '7',
    type: 5,
    relatedMan: '李四',
    todoList: 1
  }
]

export const worktableColumns = [
  {
    prop: 'integreate',
    label: '企业三证'
  },
  {
    prop: 'ninety',
    label: '90',
    width: '50'
  },
  {
    prop: 'thirty',
    label: '30',
    width: '50'
  },
  {
    prop: 'expire',
    label: '过期',
    width: '50'
  }
]

// 进度配置
export const itemProgress = [
  {prop: 'toBeConfirm', title: '待确认', description: ''},
  {prop: 'toBeDelivered', title: '待发货', description: ''},
  {prop: 'toBeReceive', title: '待收货', description: ''},
  {prop: 'someReceive', title: '部分收货', description: ''},
  {prop: 'rejected', title: '已拒绝', description: ''},
  {prop: 'completed', title: '已完成', description: ''}
]

// tab eveneloop
export const tabsData = [
  {label: '批发销售', name: '1', active: 1, itemProgress},
  {label: '长期寄售', name: '2', active: 2, itemProgress},
  {label: '寄售补货', name: '3', active: 3, itemProgress},
  {label: '跟台订单', name: '4', active: 4, itemProgress}
]
